#include "pch.h"
#include "ShapeStruct.h"

ShapeStruct::ShapeStruct() :
	Height(0),
	Width(0)
{
}

void ShapeStruct::ChangeDirection()
{
	if (Height == Width) return;

	if (Left + Width > 10)
	{
		return;
	}

	CELLCUBE temp[16] = { 0 };
	for (int row = 0; row < Height; row++)
	{
		for (int col = 0; col < Width; col++)
		{
			temp[col * 4 + Height-1 - row] = GetCube(row, col);
		}
	}
	int tempW = Width;
	Width = Height;
	Height = tempW;
	memcpy(m_data, temp, sizeof(temp));
}
